package model;

import java.util.Date;
import java.util.Observable;

import dao.City;
import dao.Customer;

public class ModelCustomer extends Observable{
	private Customer customer = new Customer();
//	private int OID;
//	private String nmCustomer;
//	private String nrFone;
//	private String nrDDDFone;
//	private Date dtBirth;
//	private String idSex;
//	private String idCivilStatus;
//	private String deEmail;
//	private City cdCity;
//	private String deDistrict;
//	private String nrZipCode;
//	private String deAddress;
//	private String nrAddress;
//	private String deComplement;
//	
//	private String nrFone2;
//	private String nrDDDFone2;
//	private String nrCellular;
//	private String nrDDDCellular;

//	public ModelCustomer(FrmMaintainCustomer frame) {
//		addObserver(frame);
//	}	
				
	public void update(Customer customer){
		if(customer != null){
			setOID(customer.getOID());
			setNmCustomer(customer.getNmCustomer());
			setNrFone(customer.getNrFone());
			setNrDDDFone(customer.getNrDDDFone());
			setDtBirth(customer.getDtBirth());
			setIdSex(customer.getIdSex());
			setIdCivilStatus(customer.getIdCivilStatus());
			setDeEmail(customer.getDeEmail());
			setCdCity(customer.getCity());
			setDeDistrict(customer.getDeDistrict());
			setNrZipCode(customer.getNrZipCode());
			setDeAddress(customer.getDeAddress());
			setNrAddress(customer.getNrAddress());
			setDeComplement(customer.getDeComplement());
			setNrFone2(customer.getNrFone2());
			setNrDDDFone2(customer.getNrFone2());
			setNrCellular(customer.getNrCellular());
			setNrDDDCellular(customer.getNrDDDCellular());
			
			setChanged();
			notifyObservers();
		}
	}
	
	public Customer getCustomer() {
		return customer;
	}
		
	public int getOID() {
		return customer.getOID();
	}
	public void setOID(int oID) {
//		OID = oID;
		customer.setOID(oID);
	}	
	public String getNmCustomer() {
		return customer.getNmCustomer();
	}
	public void setNmCustomer(String nmCustomer) {
//		this.nmCustomer = nmCustomer;
		customer.setNmCustomer(nmCustomer);
	}
	public String getNrFone() {
		return customer.getNrFone();
	}
	public void setNrFone(String nrFone) {
//		this.nrFone = nrFone;
		customer.setNrFone(nrFone);
	}
	public String getNrDDDFone() {
		return customer.getNrDDDFone();
	}
	public void setNrDDDFone(String nrDDDFone) {
//		this.nrDDDFone = nrDDDFone;
		customer.setNrDDDFone(nrDDDFone);
	}
	public Date getDtBirth() {
		return customer.getDtBirth();
	}
	public void setDtBirth(Date dtBirth) {
//		this.dtBirth = dtBirth;
		customer.setDtBirth(dtBirth);
	}
	public String getIdSex() {
		return customer.getIdSex();
	}
	public void setIdSex(String idSex) {
//		this.idSex = idSex;
		customer.setIdSex(idSex);
	}
	public String getIdCivilStatus() {
		return customer.getIdCivilStatus();
	}
	public void setIdCivilStatus(String idCivilStatus) {
//		this.idCivilStatus = idCivilStatus;
		customer.setIdCivilStatus(idCivilStatus);
	}
	public String getDeEmail() {
		return customer.getDeEmail();
	}
	public void setDeEmail(String deEmail) {
//		this.deEmail = deEmail;
		customer.setDeEmail(deEmail);
	}
	public City getCdCity() {
		return customer.getCity();
	}
	public void setCdCity(City city) {
		customer.setCity(city);
		setChanged();
		notifyObservers();
	}
	public String getDeDistrict() {
		return customer.getDeDistrict();
	}
	public void setDeDistrict(String deDistrict) {
//		this.deDistrict = deDistrict;
		customer.setDeDistrict(deDistrict);
	}
	public String getNrZipCode() {
		return customer.getNrZipCode();
	}
	public void setNrZipCode(String nrZipCode) {
//		this.nrZipCode = nrZipCode;
		customer.setNrZipCode(nrZipCode);
	}
	public String getDeAddress() {
		return customer.getDeAddress();
	}
	public void setDeAddress(String deAddress) {
//		this.deAddress = deAddress;
		customer.setDeAddress(deAddress);
	}
	public String getNrAddress() {
		return customer.getNrAddress();
	}
	public void setNrAddress(String nrAddress) {
//		this.nrAddress = nrAddress;
		customer.setNrAddress(nrAddress);
	}
	public String getDeComplement() {
		return customer.getDeComplement();
	}
	public void setDeComplement(String deComplement) {
//		this.deComplement = deComplement;
		customer.setDeComplement(deComplement);
	}
	public String getNrFone2() {
		return customer.getNrFone2();
	}
	public void setNrFone2(String nrFone2) {
//		this.nrFone2 = nrFone2;
		customer.setNrFone2(nrFone2);
	}
	public String getNrDDDFone2() {
		return customer.getNrDDDFone2();
	}
	public void setNrDDDFone2(String nrDDDFone2) {
//		this.nrDDDFone2 = nrDDDFone2;
		customer.setNrDDDFone2(nrDDDFone2);
	}
	public String getNrCellular() {
		return customer.getNrCellular();
	}
	public void setNrCellular(String nrCellular) {
//		this.nrCellular = nrCellular;
		customer.setNrCellular(nrCellular);
	}
	public String getNrDDDCellular() {
		return customer.getNrDDDCellular();
	}
	public void setNrDDDCellular(String nrDDDCellular) {
//		this.nrDDDCellular = nrDDDCellular;
		customer.setNrDDDCellular(nrDDDCellular);
	}
	public String toString(){
		return customer.getNmCustomer();
	}	
}
